package com.zty.factory_method_pattern;

import com.zty.factory_method_pattern.factory.AimaFactory;
import com.zty.factory_method_pattern.factory.BicycleFactory;
import com.zty.factory_method_pattern.factory.YadeaFactory;
import com.zty.factory_method_pattern.product.Bicycle;
import com.zty.utils.ReadXML;

/**
 * @author tyzhang19
 * @Description 工厂方法模式主方法
 * @date 2021-08-02 18:29
 */
public class FactoryMethodDemo {

    public static void main(String[] args) {
        try {
            Bicycle a;
            BicycleFactory bf;
            bf = (BicycleFactory)ReadXML.getObject();
            a = bf.produce();
            a.show();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}

